package com.yy.micro.magic.core.condition;

import org.springframework.stereotype.Component;

public interface Condition <T>{

    boolean match(T t);

    @Component
    class FalseCondition<T> implements Condition<T>{

        @Override
        public boolean match(final T t) {
            return false;
        }
    }

    @Component
    class TrueCondition<T> implements Condition<T>{

        @Override
        public boolean match(final T t) {
            return true;
        }
    }

    @Component
    class DefaultCondition<T> implements Condition<T>{

        @Override
        public boolean match(final T t) {
            return false;
        }
    }

}
